package com.itheima.constant;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class ICONConst {

    public static List<String> iconlist =new ArrayList<>();

    static{
        iconlist.add("el-icon-edit");
        iconlist.add("el-icon-delete");
    }

    public static List<String> getAllIcons(){
        return iconlist;
    }

    public static List<String> getAllIcons(String iconname){

        if (iconlist.contains(iconname)){
            //如果存在则调整到第一个
            Set<String> slist = new HashSet<>();
            slist.addAll(iconlist);
            slist.remove(iconname);
            iconlist.addAll(slist);
            iconlist.add(0,iconname);
            //删除  添加
        }else{
            //直接添加到第一个
            iconlist.add(0,iconname);
        }




        return iconlist;
    }

}
